package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.medicalmodel.HealthRecordsBean;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.OnHistoryDailyListenter;

/**
 * author : 许建宏
 * Date: 2017/12/7 0007
 * View:生命史
 */

public class HealthRecordsPresenter {

    private RequestModel requestModel;
    private AnotherResultListener<HealthRecordsBean> anotherResultListener;

    public HealthRecordsPresenter(AnotherResultListener<HealthRecordsBean> anotherResultListener){
        this.requestModel = new RequestModel();
        this.anotherResultListener = anotherResultListener;
    }


    public void LXT_HealthRecords(String startTime,String endTime,String page,String type){
        requestModel.LXT_HealthRecordsData(startTime, endTime, page,type, new AnotherResultListener<HealthRecordsBean>() {
            @Override
            public void onSuccess(HealthRecordsBean data) {
                anotherResultListener.onSuccess(data);
            }

            @Override
            public void onError(String msg) {
                anotherResultListener.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                anotherResultListener.onRefreshUI();
            }
        });
    }

}
